.class Lcom/hyphenate/chat/EMPushHelper;
.super Ljava/lang/Object;


# static fields
.field public static final TAG:Ljava/lang/String;

.field private static instance:Lcom/hyphenate/chat/EMPushHelper;


# instance fields
.field private isLogout:Z

.field private notifyDeviceToken:Ljava/lang/String;

.field private pushThread:Ljava/lang/Thread;

.field private pushType:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

.field private sendTokenLock:Ljava/lang/Object;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const-class v0, Lcom/hyphenate/chat/EMPushHelper;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    return-void
.end method

.method constructor <init>()V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->pushThread:Ljava/lang/Thread;

    new-instance v0, Ljava/lang/Object;

    invoke-direct {v0}, Ljava/lang/Object;-><init>()V

    iput-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->sendTokenLock:Ljava/lang/Object;

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/hyphenate/chat/EMPushHelper;->isLogout:Z

    sget-object v0, Lcom/hyphenate/chat/EMPushHelper$EMPushType;->NORMAL:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    iput-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->pushType:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    return-void
.end method

.method public static getInstance()Lcom/hyphenate/chat/EMPushHelper;
    .locals 1

    sget-object v0, Lcom/hyphenate/chat/EMPushHelper;->instance:Lcom/hyphenate/chat/EMPushHelper;

    if-nez v0, :cond_0

    new-instance v0, Lcom/hyphenate/chat/EMPushHelper;

    invoke-direct {v0}, Lcom/hyphenate/chat/EMPushHelper;-><init>()V

    sput-object v0, Lcom/hyphenate/chat/EMPushHelper;->instance:Lcom/hyphenate/chat/EMPushHelper;

    :cond_0
    sget-object v0, Lcom/hyphenate/chat/EMPushHelper;->instance:Lcom/hyphenate/chat/EMPushHelper;

    return-object v0
.end method


# virtual methods
.method checkAvailablePushService()Z
    .locals 8

    const/4 v1, 0x1

    const/4 v0, 0x0

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/a/b;->j()Z

    move-result v2

    sget-object v3, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v5, "GCM is enabled : "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    if-eqz v2, :cond_1

    :try_start_0
    const-string/jumbo v2, "com.google.android.gms.common.GooglePlayServicesUtil"

    invoke-static {v2}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v2

    if-eqz v2, :cond_1

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMClient;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-static {v2}, Lcom/google/android/gms/common/GooglePlayServicesUtil;->isGooglePlayServicesAvailable(Landroid/content/Context;)I

    move-result v2

    if-nez v2, :cond_0

    move v0, v1

    :cond_0
    sget-object v2, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v4, "GCM service available : "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    if-eqz v0, :cond_1

    sget-object v2, Lcom/hyphenate/chat/EMPushHelper$EMPushType;->GCM:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    invoke-virtual {p0, v2}, Lcom/hyphenate/chat/EMPushHelper;->setPushType(Lcom/hyphenate/chat/EMPushHelper$EMPushType;)V
    :try_end_0
    .catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_7

    :cond_1
    :goto_0
    if-eqz v0, :cond_2

    :goto_1
    return v0

    :catch_0
    move-exception v2

    move-object v7, v2

    move v2, v0

    move-object v0, v7

    sget-object v3, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v5, ""

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v0}, Ljava/lang/ClassNotFoundException;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v3, v0}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    move v0, v2

    goto :goto_0

    :cond_2
    :try_start_1
    const-string/jumbo v2, "com.xiaomi.mipush.sdk.MiPushClient"

    invoke-static {v2}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v2

    if-eqz v2, :cond_3

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMClient;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-static {v2}, Lcom/xiaomi/mipush/sdk/MiPushClient;->shouldUseMIUIPush(Landroid/content/Context;)Z
    :try_end_1
    .catch Ljava/lang/ClassNotFoundException; {:try_start_1 .. :try_end_1} :catch_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2

    move-result v0

    :try_start_2
    sget-object v2, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v4, "mipush available : "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    if-eqz v0, :cond_3

    sget-object v2, Lcom/hyphenate/chat/EMPushHelper$EMPushType;->MIPUSH:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    invoke-virtual {p0, v2}, Lcom/hyphenate/chat/EMPushHelper;->setPushType(Lcom/hyphenate/chat/EMPushHelper$EMPushType;)V
    :try_end_2
    .catch Ljava/lang/ClassNotFoundException; {:try_start_2 .. :try_end_2} :catch_6
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_5

    :cond_3
    move v2, v0

    :goto_2
    if-nez v2, :cond_4

    :try_start_3
    const-string/jumbo v0, "com.huawei.android.pushagent.api.PushManager"

    invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v0

    if-eqz v0, :cond_4

    const-string/jumbo v0, "android.os.SystemProperties"

    invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v0

    const-string/jumbo v3, "get"

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/Class;

    const/4 v5, 0x0

    const-class v6, Ljava/lang/String;

    aput-object v6, v4, v5

    invoke-virtual {v0, v3, v4}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v3

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/Object;

    const/4 v5, 0x0

    const-string/jumbo v6, "ro.build.version.emui"

    aput-object v6, v4, v5

    invoke-virtual {v3, v0, v4}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_3

    move-result v0

    if-nez v0, :cond_4

    const/4 v0, 0x1

    :try_start_4
    sget-object v2, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v4, "huawei push available : "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v2, v0}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    sget-object v0, Lcom/hyphenate/chat/EMPushHelper$EMPushType;->HUAWEIPUSH:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    invoke-virtual {p0, v0}, Lcom/hyphenate/chat/EMPushHelper;->setPushType(Lcom/hyphenate/chat/EMPushHelper$EMPushType;)V
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_4

    move v0, v1

    goto/16 :goto_1

    :catch_1
    move-exception v2

    move-object v7, v2

    move v2, v0

    move-object v0, v7

    :goto_3
    sget-object v3, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    const-string/jumbo v4, "no mipush sdk"

    invoke-static {v3, v4}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/lang/ClassNotFoundException;->printStackTrace()V

    goto :goto_2

    :catch_2
    move-exception v2

    move-object v7, v2

    move v2, v0

    move-object v0, v7

    :goto_4
    sget-object v3, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    const-string/jumbo v4, "exception, regard it as no mipush sdk"

    invoke-static {v3, v4}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_2

    :catch_3
    move-exception v0

    move-object v1, v0

    move v0, v2

    :goto_5
    sget-object v2, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    const-string/jumbo v3, "no huawei push sdk or mobile is not a huawei phone"

    invoke-static {v2, v3}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto/16 :goto_1

    :catch_4
    move-exception v0

    move-object v7, v0

    move v0, v1

    move-object v1, v7

    goto :goto_5

    :catch_5
    move-exception v2

    move-object v7, v2

    move v2, v0

    move-object v0, v7

    goto :goto_4

    :catch_6
    move-exception v2

    move-object v7, v2

    move v2, v0

    move-object v0, v7

    goto :goto_3

    :catch_7
    move-exception v2

    goto/16 :goto_0

    :cond_4
    move v0, v2

    goto/16 :goto_1
.end method

.method getDeviceToken()Ljava/lang/String;
    .locals 6

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMPushHelper;->getPushToken()Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_1

    :cond_0
    :goto_0
    return-object v0

    :cond_1
    :try_start_0
    invoke-virtual {p0}, Lcom/hyphenate/chat/EMPushHelper;->getPushType()Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    move-result-object v1

    sget-object v2, Lcom/hyphenate/chat/EMPushHelper$EMPushType;->GCM:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    if-ne v1, v2, :cond_5

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v1

    invoke-virtual {v1}, Lcom/hyphenate/chat/EMClient;->getOptions()Lcom/hyphenate/chat/EMOptions;

    move-result-object v1

    invoke-virtual {v1}, Lcom/hyphenate/chat/EMOptions;->getGCMNumber()Ljava/lang/String;

    move-result-object v1

    if-eqz v1, :cond_3

    const/4 v1, 0x0

    if-nez v1, :cond_2

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v1

    invoke-virtual {v1}, Lcom/hyphenate/chat/EMClient;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lcom/google/android/gms/gcm/GoogleCloudMessaging;->getInstance(Landroid/content/Context;)Lcom/google/android/gms/gcm/GoogleCloudMessaging;

    move-result-object v1

    :cond_2
    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/String;

    const/4 v3, 0x0

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v4

    invoke-virtual {v4}, Lcom/hyphenate/chat/EMClient;->getOptions()Lcom/hyphenate/chat/EMOptions;

    move-result-object v4

    invoke-virtual {v4}, Lcom/hyphenate/chat/EMOptions;->getGCMNumber()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-virtual {v1, v2}, Lcom/google/android/gms/gcm/GoogleCloudMessaging;->register([Ljava/lang/String;)Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    move-result-object v0

    :cond_3
    :goto_1
    sget-object v1, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "devicetoken = "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    if-eqz v0, :cond_4

    const-string/jumbo v1, ""

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    :cond_4
    sget-object v1, Lcom/hyphenate/chat/EMPushHelper$EMPushType;->NORMAL:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    invoke-virtual {p0, v1}, Lcom/hyphenate/chat/EMPushHelper;->setPushType(Lcom/hyphenate/chat/EMPushHelper$EMPushType;)V

    goto :goto_0

    :cond_5
    :try_start_1
    sget-object v2, Lcom/hyphenate/chat/EMPushHelper$EMPushType;->MIPUSH:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    if-ne v1, v2, :cond_6

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v1

    invoke-virtual {v1}, Lcom/hyphenate/chat/EMClient;->getOptions()Lcom/hyphenate/chat/EMOptions;

    move-result-object v1

    invoke-virtual {v1}, Lcom/hyphenate/chat/EMOptions;->getMipushConfig()Lcom/hyphenate/chat/a/b$b;

    move-result-object v1

    if-eqz v1, :cond_3

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMClient;->getContext()Landroid/content/Context;

    move-result-object v2

    iget-object v3, v1, Lcom/hyphenate/chat/a/b$b;->a:Ljava/lang/String;

    iget-object v1, v1, Lcom/hyphenate/chat/a/b$b;->b:Ljava/lang/String;

    invoke-static {v2, v3, v1}, Lcom/xiaomi/mipush/sdk/MiPushClient;->registerPush(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    iget-object v2, p0, Lcom/hyphenate/chat/EMPushHelper;->sendTokenLock:Ljava/lang/Object;

    monitor-enter v2
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    :try_start_2
    iget-object v1, p0, Lcom/hyphenate/chat/EMPushHelper;->sendTokenLock:Ljava/lang/Object;

    invoke-virtual {v1}, Ljava/lang/Object;->wait()V
    :try_end_2
    .catch Ljava/lang/InterruptedException; {:try_start_2 .. :try_end_2} :catch_0
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    :goto_2
    :try_start_3
    monitor-exit v2
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    :try_start_4
    iget-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->notifyDeviceToken:Ljava/lang/String;
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_1

    goto :goto_1

    :catch_0
    move-exception v1

    :try_start_5
    invoke-virtual {v1}, Ljava/lang/InterruptedException;->printStackTrace()V

    goto :goto_2

    :catchall_0
    move-exception v1

    monitor-exit v2
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_0

    :try_start_6
    throw v1
    :try_end_6
    .catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_1

    :catch_1
    move-exception v1

    sget-object v2, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v4, "get device token with error: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v1}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v2, v1}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    :cond_6
    :try_start_7
    sget-object v2, Lcom/hyphenate/chat/EMPushHelper$EMPushType;->HUAWEIPUSH:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    if-ne v1, v2, :cond_3

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v1

    invoke-virtual {v1}, Lcom/hyphenate/chat/EMClient;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lcom/huawei/android/pushagent/api/PushManager;->requestToken(Landroid/content/Context;)V

    iget-object v2, p0, Lcom/hyphenate/chat/EMPushHelper;->sendTokenLock:Ljava/lang/Object;

    monitor-enter v2
    :try_end_7
    .catch Ljava/lang/Exception; {:try_start_7 .. :try_end_7} :catch_1

    :try_start_8
    iget-object v1, p0, Lcom/hyphenate/chat/EMPushHelper;->sendTokenLock:Ljava/lang/Object;

    const-wide/32 v4, 0xea60

    invoke-virtual {v1, v4, v5}, Ljava/lang/Object;->wait(J)V
    :try_end_8
    .catch Ljava/lang/InterruptedException; {:try_start_8 .. :try_end_8} :catch_2
    .catchall {:try_start_8 .. :try_end_8} :catchall_1

    :goto_3
    :try_start_9
    monitor-exit v2
    :try_end_9
    .catchall {:try_start_9 .. :try_end_9} :catchall_1

    :try_start_a
    iget-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->notifyDeviceToken:Ljava/lang/String;
    :try_end_a
    .catch Ljava/lang/Exception; {:try_start_a .. :try_end_a} :catch_1

    goto/16 :goto_1

    :catch_2
    move-exception v1

    :try_start_b
    invoke-virtual {v1}, Ljava/lang/InterruptedException;->printStackTrace()V

    goto :goto_3

    :catchall_1
    move-exception v1

    monitor-exit v2
    :try_end_b
    .catchall {:try_start_b .. :try_end_b} :catchall_1

    :try_start_c
    throw v1
    :try_end_c
    .catch Ljava/lang/Exception; {:try_start_c .. :try_end_c} :catch_1
.end method

.method public getPushToken()Ljava/lang/String;
    .locals 1

    invoke-static {}, Lcom/hyphenate/chat/a/e;->a()Lcom/hyphenate/chat/a/e;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/a/e;->m()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getPushType()Lcom/hyphenate/chat/EMPushHelper$EMPushType;
    .locals 1

    iget-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->pushType:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    return-object v0
.end method

.method isPushServiceEnabled()Z
    .locals 2

    iget-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->pushType:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    sget-object v1, Lcom/hyphenate/chat/EMPushHelper$EMPushType;->NORMAL:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    if-eq v0, v1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public onDestroy(Z)V
    .locals 3

    const/4 v2, 0x0

    sget-object v0, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    const-string/jumbo v1, "push notification helper ondestory"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {p0, v2}, Lcom/hyphenate/chat/EMPushHelper;->onReceiveToken(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->pushThread:Ljava/lang/Thread;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->pushThread:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->interrupt()V

    iput-object v2, p0, Lcom/hyphenate/chat/EMPushHelper;->pushThread:Ljava/lang/Thread;

    :cond_0
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/hyphenate/chat/EMPushHelper;->isLogout:Z

    if-eqz p1, :cond_2

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMPushHelper;->isPushServiceEnabled()Z

    move-result v0

    if-eqz v0, :cond_2

    const-string/jumbo v0, ""

    invoke-virtual {p0, v0}, Lcom/hyphenate/chat/EMPushHelper;->sendTokenToServer(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_1

    sget-object v0, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    const-string/jumbo v1, "unbind device token faild"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    new-instance v0, Lcom/hyphenate/exceptions/HyphenateException;

    const/16 v1, 0xd4

    const-string/jumbo v2, "unbind device token failed"

    invoke-direct {v0, v1, v2}, Lcom/hyphenate/exceptions/HyphenateException;-><init>(ILjava/lang/String;)V

    throw v0

    :cond_1
    sget-object v0, Lcom/hyphenate/chat/EMPushHelper$EMPushType;->NORMAL:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    invoke-virtual {p0, v0}, Lcom/hyphenate/chat/EMPushHelper;->setPushType(Lcom/hyphenate/chat/EMPushHelper$EMPushType;)V

    :cond_2
    return-void
.end method

.method onInit()V
    .locals 1

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/hyphenate/chat/EMPushHelper;->isLogout:Z

    return-void
.end method

.method onReceiveToken(Ljava/lang/String;)V
    .locals 2

    iput-object p1, p0, Lcom/hyphenate/chat/EMPushHelper;->notifyDeviceToken:Ljava/lang/String;

    iget-object v1, p0, Lcom/hyphenate/chat/EMPushHelper;->sendTokenLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_0
    iget-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->sendTokenLock:Ljava/lang/Object;

    invoke-virtual {v0}, Ljava/lang/Object;->notify()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :goto_0
    :try_start_1
    monitor-exit v1

    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit v1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method

.method sendDeviceInfo(Ljava/lang/String;)Z
    .locals 6

    const/4 v1, 0x1

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/a/b;->f()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v2, "/devices"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    new-instance v2, Lorg/json/JSONObject;

    invoke-direct {v2}, Lorg/json/JSONObject;-><init>()V

    :try_start_0
    const-string/jumbo v3, "model"

    const-string/jumbo v4, "android"

    invoke-virtual {v2, v3, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v3, "name"

    invoke-virtual {v2, v3, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v3, "token"

    invoke-virtual {v2, v3, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v3, "sdk_version"

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v4

    invoke-virtual {v4}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v4

    invoke-virtual {v4}, Lcom/hyphenate/chat/a/b;->e()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string/jumbo v3, "os_version"

    sget-object v4, Landroid/os/Build$VERSION;->RELEASE:Ljava/lang/String;

    invoke-virtual {v2, v3, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    new-instance v3, Lcom/hyphenate/util/DeviceUuidFactory;

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v4

    invoke-virtual {v4}, Lcom/hyphenate/chat/EMClient;->getContext()Landroid/content/Context;

    move-result-object v4

    invoke-direct {v3, v4}, Lcom/hyphenate/util/DeviceUuidFactory;-><init>(Landroid/content/Context;)V

    invoke-virtual {v3}, Lcom/hyphenate/util/DeviceUuidFactory;->getDeviceUuid()Ljava/util/UUID;

    move-result-object v3

    invoke-virtual {v3}, Ljava/util/UUID;->toString()Ljava/lang/String;

    move-result-object v3

    const-string/jumbo v4, "device_uuid"

    invoke-virtual {v2, v4, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    invoke-static {}, Lcom/hyphenate/cloud/EMHttpClient;->getInstance()Lcom/hyphenate/cloud/EMHttpClient;

    move-result-object v3

    const/4 v4, 0x0

    invoke-virtual {v2}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v2

    sget-object v5, Lcom/hyphenate/cloud/EMHttpClient;->POST:Ljava/lang/String;

    invoke-virtual {v3, v0, v4, v2, v5}, Lcom/hyphenate/cloud/EMHttpClient;->sendRequest(Ljava/lang/String;Ljava/util/Map;Ljava/lang/String;Ljava/lang/String;)Landroid/util/Pair;

    move-result-object v2

    iget-object v0, v2, Landroid/util/Pair;->first:Ljava/lang/Object;

    check-cast v0, Ljava/lang/Integer;

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v3

    iget-object v0, v2, Landroid/util/Pair;->second:Ljava/lang/Object;

    check-cast v0, Ljava/lang/String;

    packed-switch v3, :pswitch_data_0

    const-string/jumbo v2, "duplicate_unique_property_exists"

    invoke-virtual {v0, v2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_0

    sget-object v0, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    const-string/jumbo v2, "device token already exists"

    invoke-static {v0, v2}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {p0, p1}, Lcom/hyphenate/chat/EMPushHelper;->setPushToken(Ljava/lang/String;)V

    move v0, v1

    :goto_0
    return v0

    :pswitch_0
    invoke-virtual {p0, p1}, Lcom/hyphenate/chat/EMPushHelper;->setPushToken(Ljava/lang/String;)V

    sget-object v0, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    const-string/jumbo v2, "sendDeviceToServer SC_OK:"

    invoke-static {v0, v2}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    move v0, v1

    goto :goto_0

    :cond_0
    sget-object v1, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "sendDeviceToServer error : "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v1, v0}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_1
    const/4 v0, 0x0

    goto :goto_0

    :catch_0
    move-exception v0

    sget-object v1, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    invoke-virtual {v0}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v1, v0}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    nop

    :pswitch_data_0
    .packed-switch 0xc8
        :pswitch_0
    .end packed-switch
.end method

.method sendDeviceTokenToServer()V
    .locals 2

    invoke-virtual {p0}, Lcom/hyphenate/chat/EMPushHelper;->isPushServiceEnabled()Z

    move-result v0

    if-eqz v0, :cond_3

    sget-object v0, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    const-string/jumbo v1, "third-party push available"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    iget-boolean v0, p0, Lcom/hyphenate/chat/EMPushHelper;->isLogout:Z

    if-eqz v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->pushThread:Ljava/lang/Thread;

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->pushThread:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->isAlive()Z

    move-result v0

    if-nez v0, :cond_0

    :cond_2
    iget-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->pushThread:Ljava/lang/Thread;

    if-nez v0, :cond_0

    new-instance v0, Lcom/hyphenate/chat/EMPushHelper$1;

    invoke-direct {v0, p0}, Lcom/hyphenate/chat/EMPushHelper$1;-><init>(Lcom/hyphenate/chat/EMPushHelper;)V

    iput-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->pushThread:Ljava/lang/Thread;

    iget-object v0, p0, Lcom/hyphenate/chat/EMPushHelper;->pushThread:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    goto :goto_0

    :cond_3
    sget-object v0, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    const-string/jumbo v1, "GCM and mipush not available"

    invoke-static {v0, v1}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0
.end method

.method sendTokenToServer(Ljava/lang/String;)Z
    .locals 7

    iget-object v1, p0, Lcom/hyphenate/chat/EMPushHelper;->sendTokenLock:Ljava/lang/Object;

    monitor-enter v1

    :try_start_0
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMClient;->getChatConfigPrivate()Lcom/hyphenate/chat/a/b;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/a/b;->f()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v2, "/users/"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMClient;->getCurrentUser()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v2

    :try_start_1
    new-instance v3, Lorg/json/JSONObject;

    invoke-direct {v3}, Lorg/json/JSONObject;-><init>()V

    const-string/jumbo v0, "device_token"

    invoke-virtual {v3, v0, p1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const/4 v0, 0x0

    sget-object v4, Lcom/hyphenate/chat/EMPushHelper$2;->$SwitchMap$com$hyphenate$chat$EMPushHelper$EMPushType:[I

    iget-object v5, p0, Lcom/hyphenate/chat/EMPushHelper;->pushType:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    invoke-virtual {v5}, Lcom/hyphenate/chat/EMPushHelper$EMPushType;->ordinal()I

    move-result v5

    aget v4, v4, v5

    packed-switch v4, :pswitch_data_0

    :goto_0
    if-nez v0, :cond_0

    const-string/jumbo v0, ""

    :cond_0
    const-string/jumbo v4, "notifier_name"

    invoke-virtual {v3, v4, v0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    sget-object v4, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v6, "send device token to server, token = "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string/jumbo v6, ",url = "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string/jumbo v6, ",notifier_name = "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v4, v0}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V

    invoke-static {}, Lcom/hyphenate/cloud/EMHttpClient;->getInstance()Lcom/hyphenate/cloud/EMHttpClient;

    move-result-object v0

    invoke-virtual {v3}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v3

    sget-object v4, Lcom/hyphenate/cloud/EMHttpClient;->PUT:Ljava/lang/String;

    invoke-virtual {v0, v2, v3, v4}, Lcom/hyphenate/cloud/EMHttpClient;->sendRequestWithToken(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/util/Pair;

    move-result-object v2

    iget-object v0, v2, Landroid/util/Pair;->first:Ljava/lang/Object;

    check-cast v0, Ljava/lang/Integer;

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v3

    iget-object v0, v2, Landroid/util/Pair;->second:Ljava/lang/Object;

    check-cast v0, Ljava/lang/String;

    packed-switch v3, :pswitch_data_1

    sget-object v2, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v4, "sendTokenToServer error:"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v2, v0}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    :goto_1
    const/4 v0, 0x0

    :try_start_2
    monitor-exit v1
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    :goto_2
    return v0

    :pswitch_0
    :try_start_3
    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->getOptions()Lcom/hyphenate/chat/EMOptions;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMOptions;->getGCMNumber()Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    :pswitch_1
    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->getOptions()Lcom/hyphenate/chat/EMOptions;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMOptions;->getMipushConfig()Lcom/hyphenate/chat/a/b$b;

    move-result-object v0

    iget-object v0, v0, Lcom/hyphenate/chat/a/b$b;->a:Ljava/lang/String;

    goto/16 :goto_0

    :pswitch_2
    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->getOptions()Lcom/hyphenate/chat/EMOptions;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMOptions;->getHuaweiPushAppId()Ljava/lang/String;

    move-result-object v0

    goto/16 :goto_0

    :pswitch_3
    sget-object v0, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    const-string/jumbo v2, "sendTokenToServer SC_OK:"

    invoke-static {v0, v2}, Lcom/hyphenate/util/EMLog;->d(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_0
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    const/4 v0, 0x1

    :try_start_4
    monitor-exit v1

    goto :goto_2

    :catchall_0
    move-exception v0

    monitor-exit v1
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    throw v0

    :catch_0
    move-exception v0

    :try_start_5
    sget-object v2, Lcom/hyphenate/chat/EMPushHelper;->TAG:Ljava/lang/String;

    invoke-virtual {v0}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v2, v0}, Lcom/hyphenate/util/EMLog;->e(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_0

    goto :goto_1

    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
        :pswitch_2
    .end packed-switch

    :pswitch_data_1
    .packed-switch 0xc8
        :pswitch_3
    .end packed-switch
.end method

.method public setPushToken(Ljava/lang/String;)V
    .locals 1

    invoke-static {}, Lcom/hyphenate/chat/a/e;->a()Lcom/hyphenate/chat/a/e;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/hyphenate/chat/a/e;->d(Ljava/lang/String;)V

    return-void
.end method

.method public setPushType(Lcom/hyphenate/chat/EMPushHelper$EMPushType;)V
    .locals 0

    iput-object p1, p0, Lcom/hyphenate/chat/EMPushHelper;->pushType:Lcom/hyphenate/chat/EMPushHelper$EMPushType;

    return-void
.end method
